package ru.arriah.servicedesk.bean;

import java.sql.ResultSet;
import ru.arriah.common.bean.GenericBean;

public class DepartmentBean extends GenericBean {

   private int organizationId;
   private String name;
   private String status;

   public DepartmentBean() {
      super();
   }

   public DepartmentBean(ResultSet resultSet) {
      fillFromResultSet(resultSet);
   }
   
   @Override
   public void fillFromResultSet(ResultSet resultSet) {
      try {
         setId(resultSet.getInt("department.id"));
         setName(resultSet.getString("department.name"));
         setOrganizationId(resultSet.getInt("department.organization_id"));
         setStatus(resultSet.getString("department.status"));
      } catch (Exception e) {
         // TODO: handle exception
         e.printStackTrace();
      }
   }

   public String getStatus() {
      return status;
   }

   public void setStatus(String status) {
      this.status = status;
   }

   public int getOrganizationId() {
      return organizationId;
   }

   public void setOrganizationId(int organizationId) {
      this.organizationId = organizationId;
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public boolean isValid() {
      return true;
   }
}